'\" et
.TH POSIX_TRACE_CLOSE "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
.\"
.SH PROLOG
This manual page is part of the POSIX Programmer's Manual.
The Linux implementation of this interface may differ (consult
the corresponding Linux manual page for details of Linux behavior),
or the interface may not be implemented on Linux.
.\"
.SH NAME
posix_trace_close,
posix_trace_open,
posix_trace_rewind
\(em trace log management
(\fBTRACING\fP)
.SH SYNOPSIS
.LP
.nf
#include <trace.h>
.P
int posix_trace_close(trace_id_t \fItrid\fP);
int posix_trace_open(int \fIfile_desc\fP, trace_id_t *\fItrid\fP);
int posix_trace_rewind(trace_id_t \fItrid\fP);
.fi
.SH DESCRIPTION
The
\fIposix_trace_close\fR()
function shall deallocate the trace log identifier indicated by
.IR trid ,
and all of its associated resources. If there is no valid trace log
pointed to by the
.IR trid ,
this function shall fail.
.P
The
\fIposix_trace_open\fR()
function shall allocate the necessary resources and establish the
connection between a trace log identified by the
.IR file_desc
argument and a trace stream identifier identified by the object pointed
to by the
.IR trid
argument. The
.IR file_desc
argument should be a valid open file descriptor that corresponds to a
trace log. The
.IR file_desc
argument shall be open for reading. The current trace event timestamp,
which specifies the timestamp of the trace event that will be read by
the next call to
\fIposix_trace_getnext_event\fR(),
shall be set to the timestamp of the oldest trace event recorded in the
trace log identified by
.IR trid .
.P
The
\fIposix_trace_open\fR()
function shall return a trace stream identifier in the variable
pointed to by the
.IR trid
argument, that may only be used by the following functions:
.TS
tab(!);
l l.
T{
.nf
\fIposix_trace_close\fR()
\fIposix_trace_eventid_equal\fR()
\fIposix_trace_eventid_get_name\fR()
\fIposix_trace_eventtypelist_getnext_id\fR()
\fIposix_trace_eventtypelist_rewind\fR()
T}!T{
.nf
\fIposix_trace_get_attr\fR()
\fIposix_trace_get_status\fR()
\fIposix_trace_getnext_event\fR()
\fIposix_trace_rewind\fR()
.fi
T}
.TE
.P
In particular, notice that the operations normally used by a trace
controller process, such as
\fIposix_trace_start\fR(),
\fIposix_trace_stop\fR(),
or
\fIposix_trace_shutdown\fR(),
cannot be invoked using the trace stream identifier returned by the
\fIposix_trace_open\fR()
function.
.P
The
\fIposix_trace_rewind\fR()
function shall reset the current trace event timestamp, which specifies
the timestamp of the trace event that will be read by the next call to
\fIposix_trace_getnext_event\fR(),
to the timestamp of the oldest trace event recorded in the trace log
identified by
.IR trid .
.SH "RETURN VALUE"
Upon successful completion, these functions shall return a value of
zero. Otherwise, they shall return the corresponding error number.
.P
If successful, the
\fIposix_trace_open\fR()
function stores the trace stream identifier value in the object pointed
to by
.IR trid .
.SH ERRORS
The
\fIposix_trace_open\fR()
function shall fail if:
.TP
.BR EINTR
The operation was interrupted by a signal and thus no trace log was
opened.
.TP
.BR EINVAL
The object pointed to by
.IR file_desc
does not correspond to a valid trace log.
.br
.P
The
\fIposix_trace_close\fR()
and
\fIposix_trace_rewind\fR()
functions may fail if:
.TP
.BR EINVAL
The object pointed to by
.IR trid
does not correspond to a valid trace log.
.LP
.IR "The following sections are informative."
.SH EXAMPLES
None.
.SH "APPLICATION USAGE"
None.
.SH RATIONALE
None.
.SH "FUTURE DIRECTIONS"
The
\fIposix_trace_close\fR(),
\fIposix_trace_open\fR(),
and
\fIposix_trace_rewind\fR()
functions may be removed in a future version.
.SH "SEE ALSO"
.ad l
.IR "\fIposix_trace_get_attr\fR\^(\|)",
.IR "\fIposix_trace_get_filter\fR\^(\|)",
.IR "\fIposix_trace_getnext_event\fR\^(\|)"
.ad b
.P
The Base Definitions volume of POSIX.1\(hy2017,
.IR "\fB<trace.h>\fP"
.\"
.SH COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form
from IEEE Std 1003.1-2017, Standard for Information Technology
-- Portable Operating System Interface (POSIX), The Open Group Base
Specifications Issue 7, 2018 Edition,
Copyright (C) 2018 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group.
In the event of any discrepancy between this version and the original IEEE and
The Open Group Standard, the original IEEE and The Open Group Standard
is the referee document. The original Standard can be obtained online at
http://www.opengroup.org/unix/online.html .
.PP
Any typographical or formatting errors that appear
in this page are most likely
to have been introduced during the conversion of the source files to
man page format. To report such errors, see
https://www.kernel.org/doc/man-pages/reporting_bugs.html .
